package my.test.map.data;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class logRecord {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key = null;

    @Persistent
    private User author = null;
    
    @Persistent
    private Date created = null;
    
    private Long epoc = null;
    
    @Persistent
    private Double lat = null;
    @Persistent
    private Double lng = null;
    
    @Persistent
    private String content = null;
    
    public logRecord(Double lat, Double lng, String content){
    	super();
    	this.lat = lat;
    	this.lng = lng;
    	this.created = new Date();
    	this.content = content;
    }
    
	public logRecord(User author, Double lat, Double lng, String content) {
		super();
		this.author = author;
		this.lat = lat;
		this.lng = lng;
		this.created = new Date();
		this.content = content;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public Date getCreated() {
		return created;
	}
	public Long getEpoc(){
		return this.epoc;
	}

	public void setCreated(Date created) {
		this.created = created;
		this.epoc = created.getTime();
	}

	public Double getLat() {
		return lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	public Double getLng() {
		return lng;
	}

	public void setLng(Double lng) {
		this.lng = lng;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Key getKey() {
		return key;
	}

}
